<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Travel</title>
<link type="text/css" rel="stylesheet" href="styles/all.css" />
<link type="text/css" rel="stylesheet" href="css/page.css" />
<script type="text/javascript" src="js/jquery-1.5.1.js"></script>
<script type="text/javascript" src="js/byPage.js"></script>
<script type="text/javascript">
	//左侧导航
	$(document).ready(function() {
		var menuList = $('.menuList');
		$('.nav input').each(function(i) {//获取列表的大标题并遍历
			$(this).click(function() {
				if ($(menuList[i]).css('display') == 'none') {
					$(menuList[i]).slideDown(200);
				} else {
					$(menuList[i]).slideUp(200);
				}
			});

		});
	});
	//全选
	function selectAdmins(inputObj) {
		var inputArray = document.getElementById("datalist")
				.getElementsByTagName("input");
		for (var i = 1; i < inputArray.length; i++) {
			if (inputArray[i].type == "checkbox") {
				inputArray[i].checked = inputObj.checked;
			}
		}
	}
	//删除
	function delAdmin(btn) {
		// console.log($(btn).parent().siblings().eq(1).text());
		var r = window.confirm("确定要删除此管理员吗？");
		if(r == true){
			location.href = "deleteVip.do?userCode=" + $(btn).parent().siblings().eq(1).text();
		
		}else{
			return false;
		}
	}
	$(function(){
		// 分页处理
		page('toVip.do');
	})	
	
</script>
</head>
<body>
	<!-- logo区 -->
	<div class="logo">
		<img src="img/logo.png" height="90px"> <img
			src="img/vip.png" height="60px" width="50px" class="vip"
			align="right" onclick="location.href='vip/vip_list.html'"> <img
			src="img/news.png" height="60px" width="45px" class="news"
			align="right" onclick="location.href='news/news_add.html'">
		<img src="img/firstpage.png" height="60px" width="50px"
			class="firstpage" align="right">
	</div>
	<!-- 小导航区 -->
	<div class="let_nav">
		<ul>
			<li><input type="button" value="返回首页" class="index"></li>
			<li><input type="button" value="退出系统" class="quit"></li>

			<li id="l2">
				<div class="search">
					<input type="text" value="" class="text_search"> <input
						type="button" value="搜索" class="btn_search">
				</div>
			</li>
		</ul>
	</div>
	<!-- 主要区域 -->
	<div id="main">
		<form action="" method="">
			<!-- 导航区 -->
			<div class="nav">
				<c:import url="../nav.jsp"></c:import>
			</div>
			<!-- 数据区域 -->
			<div class="data">
				<table id="datalist">
					<thead>
						<tr>
							<td><input type="checkbox" onclick="selectAdmins(this);">
								<span>全选</span></td>
							<td>会员账号</td>
							<td>姓名</td>
							<td>性别</td>
							<td>出生日期</td>
							<td>所在地</td>
							<td>证件类型</td>
							<td>证件号码</td>
							<td>操作</td>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${vips}" var="admin">
							<tr>
								<td><input type="checkbox"></td>
								<td>${admin.u_Code}</td>
								<td>${admin.u_Name}</td>
								<td>${admin.u_Sex}</td>
								<td>${admin.u_Birth}</td>
								<td>${admin.u_Location_prov}${admin.u_Location_city}</td>
								<td>${admin.u_DocumentType}</td>
								<td>${admin.u_IDNumber}</td>
								<td class="td_modi"><input type="button" value="删除"
									class="btn_delete" onclick="delAdmin(this);"></td>
							</tr>
						</c:forEach>

					</tbody>
				</table>
			</div>
			<!-- 分页区 -->
			<div id="page" class="page">
				<a id="pre" href="javascript:;">上一页</a>
			 	
			  	<a id="next" href="javascript:;">下一页</a>
			  	<p>第<span id="pageNum">${pageNum}</span>页，共<span id="pageCount">${pageCount}</span>页</p>
			</div>
			
		</form>
	</div>

	<!--删除操作提示-->
	<div id="operate_result_info" class="operate_fail">
		<img src="img/close.png"
			onclick="this.parentNode.style.display='none';" /> <span>删除失败！数据并发错误。</span>
	</div>
	<!-- 版权区 -->
	<div class="copy">
		<p>版权所有，违者必究</p>
	</div>
</body>
</html>
